<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div class="left">
        <div class="box">
            <img src="01.jpg" alt="">
            <span></span>
        </div>
        <ul>
            <li><img src="01.jpg" alt=""></li>
            <li><img src="02.jpg" alt=""></li>
            <li><img src="03.jpg" alt=""></li>
            <li><img src="04.jpg" alt=""></li>
            <li><img src="05.jpg" alt=""></li>
        </ul>
    </div>
    <div class="right">

    </div>
    <script>
        var boximg = document.querySelector(".box > img");
        var right = document.querySelector(".right");
        var lis = document.querySelectorAll("li");
        for(var i = 0;i < lis.length;i++){
            lis[i].onclick = function(){
                
                // console.log(this.children[0].src);
                boximg.src = this.children[0].src;
                right.style.backgroundImage = `url(${this.children[0].src})`;
            }
        }
    </script>
</body>
</html>